package com.tencreat.mq;

import com.tencreat.domain.account.AccountWithdrawAudit;
import com.tencreat.service.mall.IPayService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 杉德代付查询
 *
 * @Author lx
 * @Date: 2022/07/25 01:52
 */
@Component
@RabbitListener(queues = "base-mall.delayed.sand.name", ackMode = "AUTO")
public class SandQueryReceiver {
    private static Logger LOGGER =LoggerFactory.getLogger(SandQueryReceiver.class);
    @Autowired
    private IPayService iPayService;
    @RabbitHandler
    public void handle(AccountWithdrawAudit accountWithdrawAudit){
        LOGGER.info("send delay message sandQuery:{}",accountWithdrawAudit.getSn());
        iPayService.sandBehalfQuery(accountWithdrawAudit);
    }
}
